package com.lzy.srb.rabbitutil.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class MQService {

    @Autowired
    AmqpTemplate amqpTemplate;

    public boolean sendMessage(String exchange,
                               String routingKey,
                               Object message){
        log.info("发送消息。。。");
        amqpTemplate.convertAndSend(exchange,routingKey,message);
        return true;
    }




}
